#coding=utf-8

class Aio::Module::Cmd::Cisco::ShowCPU < Aio::Module::Cmd::Cisco
	include Aio::Module
	
	def initialize
		super({
			:cmd_full			=> "show cpu",
			:cmd_short		=> "sh cpu",
			:author				=> "Elin",
			:description	=> "This is Cisco ASA Command# show cpu",
			:ranking			=> Ranking_1,
			:platform			=> "asa",
			:benchmark		=> {
					:seconds_5	=> ["<", 50],
					:minute_1		=> ["<", 50],
					:minutes_5	=> ["<", 50],
				}
		})
	end

	def parse
		cont = self.context.dup
		cpu = {}
		useful[:cpu] = cpu
		cont.readline_match_block(/1 minute: (?<minute_1>\d+)%; 5 minutes: (?<minutes_5>\d+)%/) do |block|
		  block.warning_serious(cpu, :minute_1, self)
		  block.warning_serious(cpu, :minutes_5, self)
		end
	end
end

